package javango.contrib.admin;

import java.util.ArrayList;
import java.util.List;

import com.google.inject.Inject;

import javango.contrib.admin.views.Main;
import javango.contrib.jquery.JqueryUrls;
import javango.core.UrlFactory;
import javango.core.Url;

public class Urls implements javango.core.Urls {
	List<Url> l = new ArrayList<Url>();
	
	@Inject
	public Urls(UrlFactory factory) {
		l.add(factory.regUrl("^$", Main.class, "index"));
		l.add(factory.subappUrl("^jquery/", JqueryUrls.class));
//		l.add(factory.regUrl("^resetdb/$", Main.class, "resetdb"));
		l.add(factory.regUrl("^([^/]+)/search/$", Main.class, "search"));
		l.add(factory.regUrl("^([^/]+)/$", Main.class, "changeList"));
		l.add(factory.regUrl("^([^/]+)/add/$", Main.class, "add"));
		l.add(factory.regUrl("^([^/]+)/(.+)/delete/$", Main.class, "delete"));
		l.add(factory.regUrl("^([^/]+)/(.+)/$", Main.class, "change"));
	}
	
	public List<Url> getUrlPatterns() {
		return l;
	}

}
